package com.jielihaofeng.business.rule.entity.rule;

import com.jielihaofeng.business.rule.entity.RuleConstant;
import com.jielihaofeng.business.rule.entity.RuleDto;
import com.jielihaofeng.business.rule.entity.rule.AbstractRule;

/**
 * @author Johnnie Wind
 * @description
 * @date 2021/6/7 14:07
 */
// 具体规则- 例子1
public class AddressRule extends AbstractRule {

    @Override
    public boolean execute(RuleDto dto) {
        System.out.println("AddressRule invoke!");
        if (dto.getAddress().startsWith(RuleConstant.MATCH_ADDRESS_START)) {
            return true;
        }
        return false;
    }


}
